package de.pelizaeus.app;

import android.app.Activity;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
import android.content.Intent;
import android.net.Uri;
import android.view.View;


public class ImpressumActivity extends Activity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_impressum);
    }


    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        // Inflate the menu; this adds items to the action bar if it is present.
        getMenuInflater().inflate(R.menu.impressum, menu);
        return true;
    }

    public void onButtonClick(View view) {
        Intent intent;
        switch (view.getId()) {
            case R.id.buttonMap:
                //Map ohne Nadel, aber mit Zoom
                String uri1 = "geo:"+ 51.721023 + "," + 8.762085 + "?q=Pelizaeus-Gymnasium Paderborn"; //location+address
                Intent i1 = new Intent(Intent.ACTION_VIEW, Uri.parse(uri1));
                startActivity(i1);
                break;
            case R.id.buttonEmail:
                //Mail
                //Android 4.4.2 wahlmöglichkeit zwischen gmail und normal email
                //funktioniert auch mit 4.1.2, dabei wird jedoch Gmail bei mir sofort geöffnet, keine Wahlmöglichkeit --> bitte mit mehreren EmailProgrammen überprüfen
                intent= new Intent(Intent.ACTION_SENDTO, Uri.fromParts(
                        "mailto","miriam.fischer@gmail.com", null));
                intent.putExtra(Intent.EXTRA_SUBJECT, "Feedback Pelizaeus-App");
                startActivity(Intent.createChooser(intent, "Send email..."));
                break;
        }
    }

//intent = new Intent(Intent.ACTION_VIEW, Uri.parse("http://www.pelizaeus.de"));

    @Override
    public boolean onOptionsItemSelected(MenuItem item) {
        // Handle action bar item clicks here. The action bar will
        // automatically handle clicks on the Home/Up button, so long
        // as you specify a_gebaeude parent activity in AndroidManifest.xml.
        int id = item.getItemId();
        if (id == R.id.action_settings) {
            return true;
        }
        return super.onOptionsItemSelected(item);
    }
}